package com.ezscript.collection;

import java.util.HashMap;
import java.util.Map;

public class HashMapTest{

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		testAnd();
		String key = "key";
		int hash = key.hashCode();
		printLn(hash);
		int a = indexFor(hash,10);
		printLn(a);

	}

	private static void testAnd() {
		Map m = new HashMap();
		System.out.println(1 << 30);
		System.out.println(0x7fffffff);
		int a = 111111;
		int b = 16;
		printLn(a & (b-1));
		
		for(;b < 5000; b = b*2){
			printLn(a & (b-1));
		}
	}

	static int indexFor(int h, int length) {
		return h & (length - 1);
	}
	
	public static void printLn(Object str){
		System.out.println(str);
	}


	

}
